<?php
class sections{
	private $sectionName;
	
	/*
	 * Constructor
	 */
	function __construct() {
		$this->sectionName=$sectionName;
	}
	
	public function getSection(){
		return $this->sectionName;
	}

	public function setSection(){
		return $this->sectionName=$_POST['sectionName'];;
	}
	
	public function addSection($sectionName){
		$sectionName=$_POST['sectionName'];
		$path="C:\xampp\htdocs\librejo\trunk\files\Section\".$sectionName".".txt";
		$fp = fopen("$path", "w");
		echo $sectionName;
		echo "hola";
		fclose($fp);
	}
	
	public function savetofile($section){
		$serverpath=$_SERVER['DOCUMENT_ROOT'];
		$filename=$serverpath.'/files/'.$section.'.txt';
		$file = fopen($filename,"w");
		$Stringline = $this->section;
		fwrite($file,$Stringline);
		fclose($file);
	}
	
	public function openSections($section){
		$serverpath=$_SERVER['DOCUMENT_ROOT'];
		$filename=$serverpath.'/files/'.$section.'.txt';
		$file = fopen($filename,"r");
	}
}
?>